﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetVehiculoByDescripcion')
	BEGIN
		DROP  Procedure  GetVehiculoByDescripcion
	END

GO

CREATE Procedure GetVehiculoByDescripcion

	(
		@descripcion nvarchar(250)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	V.[IdBien],
	V.[Marca],
	V.[Modelo],
	V.[NroPlaca],
	V.[TipoVehiculo]
	FROM [Vehiculo] AS V
	INNER JOIN Bien AS B ON V.[IdBien] = B.[IdBien]
	WHERE B.[Descripcion] = @descripcion

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON GetVehiculoByDescripcion TO PUBLIC

GO


